package cn.nju.zyy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/welcome.html")
public class HelloWorldController {
	
	@ModelAttribute("message")
	public String buildMessage() {
		// can use a service class to generate the message.
		return "Hello World!";
	}

	@RequestMapping(method = RequestMethod.GET)
	public String welcome() {
		return "welcomePage";
	}

}
